package cn.lkx.servicecms.controller;


import cn.lkx.commonutils.R;
import cn.lkx.servicecms.entity.CrmBanner;
import cn.lkx.servicecms.service.CrmBannerService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端 前台控制器 （普通用户用的） 只能查看
 * </p>
 *
 * @author lkx
 * @since 2022-05-08
 */
@Api(description = "网站首页Banner列表")
@RestController
@RequestMapping("/servicecms/bannerFront")
@CrossOrigin
public class BannerFrontController {
    @Autowired
    private CrmBannerService bannerService;

    //根据sort升序 获取前4个 轮播图
    @GetMapping("getBanners")
    public R getBanners(){
        List<CrmBanner> list = bannerService.getSomeBanner();
        return R.ok().data("bannerList",list);
    }
}

